﻿using System;
using System.Reflection;

namespace MyDemo.Attributes
{
    public class ThePress
    {
        public static void Print(ISay say)
        {
            MemberInfo info = say.GetType();

            BlockAttribute att = Attribute.GetCustomAttribute(info, typeof(BlockAttribute)) as BlockAttribute;

            if (att.Level == Level.Yes)
            {
                Console.WriteLine(say.GetType().ToString() + ":" + say.Say());
            }
            else
            {
                Console.WriteLine(say.GetType().ToString() + ": " + "I Love the contry!");
            }
        }
    }
}